import { createApp } from 'vue'
import App from './App.vue'
import './assets/css/global-var.less'
import './assets/css/global-style.less'

// 使用socket.io-client
import socketio from './global/registerPlugin'
const socketConfig = {
  autoConnect: true,  // 自动连接
  transports: ['websocket'], // 指定为websocket连接
  reconnect: true,
  reconnectionAttempts: 5 // 重连次数
}

// Vue全局使用pinia
import { createPinia } from 'pinia'
const pinia = createPinia()
import router from './router'

// 使用ElementPlus
import ElementPlus from 'element-plus'
import 'element-plus/theme-chalk/index.css'

const app = createApp(App).use(pinia).use(router).use(ElementPlus)
app.use(socketio, {
  connection: 'http://localhost:3002',
  options: socketConfig
})

app.mount('#app')
